"""
计算m到n之间所有素数的和

计算m到n之间所有素数的和，其中 2 <= m <=n <=100
"""
import math


def isprime(numb):
    if numb <=1:
        return False
    if numb == 2:
        return True
    for item in range(2, int(math.sqrt(numb))+1):
        if numb % item == 0:
            return False
    return True


def resolution1():
    list = input().split(" ")
    m = int(list[0])
    n = int(list[1])
    sum = 0

    for item in range(m, n+1):
        if isprime(item):
            sum += item

    print(sum)


if __name__ == '__main__':
    resolution1()